package com.zcily.demo.entity.form;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
@ApiModel(value = "RegisterForm", description = "注册表单对象")
public class RegisterForm implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("登录帐号")
    @NotBlank(message = "登录账号不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9_]{8,20}$", message = "登录密码的长度必须在8~20位之间，且只能包含数字、字母、下划线")
    private String username;

    @ApiModelProperty("密码")
    @NotBlank(message = "登录密码不能为空")
    @Length(min = 8,max = 20, message = "登录密码的长度必须在8~20位之间")
    private String password;

    @ApiModelProperty("联系电话")
    private String phoneNumber;

    @ApiModelProperty("电子邮件")
    private String email;

    @ApiModelProperty("头像")
    private String avatar;

    @ApiModelProperty("验证码")
    private String verificationCode;
}
